# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Some tools to interact with MathOpt.

package(default_visibility = ["//visibility:private"])

cc_binary(
    name = "mathopt_solve",
    srcs = ["mathopt_solve.cc"],
    deps = [
        ":file_format_flags",
        "//ortools/base",
        "//ortools/base:status_macros",
        "//ortools/math_opt:parameters_cc_proto",
        "//ortools/math_opt/core:solver_interface",
        "//ortools/math_opt/cpp:math_opt",
        "//ortools/math_opt/cpp:statistics",
        "//ortools/math_opt/io:names_removal",
        "//ortools/math_opt/labs:solution_feasibility_checker",
        "//ortools/math_opt/solvers:cp_sat_solver",
        "//ortools/math_opt/solvers:glop_solver",
        "//ortools/math_opt/solvers:glpk_solver",
        "//ortools/math_opt/solvers:gscip_solver",
        "//ortools/math_opt/solvers:highs_solver",
        "//ortools/math_opt/solvers:pdlp_solver",
        "//ortools/util:sigint",
        "//ortools/util:status_macros",
        "@com_google_absl//absl/base:no_destructor",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log:check",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
    ],
)

cc_binary(
    name = "mathopt_convert",
    srcs = ["mathopt_convert.cc"],
    deps = [
        ":file_format_flags",
        "//ortools/base",
        "//ortools/base:status_macros",
        "//ortools/math_opt/io:names_removal",
        "//ortools/util:status_macros",
        "@com_google_absl//absl/flags:flag",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
    ],
)

cc_library(
    name = "file_format_flags",
    srcs = ["file_format_flags.cc"],
    hdrs = ["file_format_flags.h"],
    deps = [
        "//ortools/base",
        "//ortools/base:file",
        "//ortools/base:status_macros",
        "//ortools/linear_solver:linear_solver_cc_proto",
        "//ortools/math_opt:model_cc_proto",
        "//ortools/math_opt:model_parameters_cc_proto",
        "//ortools/math_opt/io:lp_converter",
        "//ortools/math_opt/io:lp_parser",
        "//ortools/math_opt/io:mps_converter",
        "//ortools/math_opt/io:proto_converter",
        "@com_google_absl//absl/algorithm:container",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/log",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)
